package com.sky.mapper;

import com.sky.entity.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

/**
 * @author guozh
 */
@Mapper
public interface UserMapper {
    /**
     * 根据 openid 获取数据
     * @param openid openid
     * @return User
     */
    @Select("select * from user where openid = #{openid}")
    User getByOpenid(String openid);

    /**
     * 插入一条数据
     * @param user user 用户数据
     */
    void insert(User user);

    @Select("select * from user where id = #{id}")
    User getById(Long id);
}
